@import 'common';

.msosh {
  @include clearfix;
  text-align: center;
  &-item {
    float: left;
    line-height: 0;
    margin: 5px;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

    &-icon {
      color: #fff;
      font-size: 20px;
      display: inline-block;
      text-decoration: none;
    }

    &-icon {
      width: 36px;
      height: 36px;
      line-height: 36px;
      border-radius: 50%;
      text-align: center;
    }

    &-text {
      display: none;
    }

    @each $name, $color in $sites {
      &.#{$name} {
        .msosh-item-icon {
          background: $color;
        }

        &:hover {
          .msosh-item-icon {
            background: darken($color, 10%);
          }
        }
      }
    }
  }

  &-group {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;

    .msosh-item {
      display: block;
      float: none;
      margin: 0;
    }
  }

  &-pop {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
    background: rgba(#000, .65);
    opacity: 0;

    &-show {
      opacity: 1;
      transition: opacity 800ms ease-in;

      @for $i from 1 through 3 {
        .group#{$i} {
          $duration: ($i - 1)*600ms+1200ms;
          animation: soshtrans $duration 1 ease;
        }
      }
    }

    &-hide {
      opacity: 0;
      transition: opacity 800ms ease-in;

      @for $i from 1 through 3 {
        .group#{$i} {
          $delay: ($i - 1)*300ms;
          animation: soshtrans2 700ms 1 cubic-bezier(0.68,-.55,.265,1.55) $delay;
        }
      }
    }

    &-sites {
      position: absolute;
      top: 50%;
      left: 0;
      width: 100%;
      transform: translate(0, -50%);
    }

    .msosh {
      &-item {

        &-icon {
          width: 60px;
          height: 60px;
          line-height: 60px;
          font-size: 28px;
          text-align: center;
        }
      }
    }
  }

  &-wxsharetip {
    position: fixed;
    overflow: hidden;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0,0,0,.6) url(../img/share_arrow.png) no-repeat right 0;
    background-size: 50% auto;
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: all 600ms ease-out;

    &.wxsharetip-show {
      z-index: 9999;
      opacity: 1;
      visibility: visible;
    }
  }
}

@keyframes soshtrans {
  0% {
    transform:translate3d(0,1136px,0);
  }
  50% {
    transform:translate3d(0,0,0);
  }
  60% {
    transform:translate3d(0,0,0);
  }
  100% {
    transform:translate3d(0,0,0);
  }
}

@keyframes soshtrans2 {
  0% {
    opacity:1;
    transform:translate3d(0,0,0);
  }
  100%{
    opacity:0;
    transform:translate3d(0,500%,0);
  }
}
